{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.title}}</h1></dt>
				<dd><form method="get"><input type="text" class="input" placeholder="请输入您需要搜索的店铺名字！" name="search"><input type="submit" value="搜索" class="button" /></form></dd>
				<dd><a href="wood_help.html"><i class="iconfont">&#xe649;</i>帮助文档</a></dd>
			</dl>
		</div>
		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						<p>通过申请后会自动生成一个店铺,但是资料并不完善,请尽快联系用户补充资料</p>
						<p>如果审核不通过请说明原因</p>
					</dt>
					<!-- <dd><a href="/admin/shop/add"><button type="button" class="button">添加店铺</button></a></dd> -->
				</dl>
			</div>
			<!-- 会员列表 -->
			<table class="table">
				<thead><th>申请人头像</th><th>申请信息</th><th>说明</th><th>申请时间</th><th>操作</th></thead>
				{{range .info}}
				<tr id="{{.id}}">
					<td class="center"><a href="/admin/member/content?id={{.uid}}"><img src="{{.pathname}}" class="img-1" onerror="javascript:this.src='/static/img/admin/avatar.jpg'"></a></td>
					<td>
						申请用户：<a href="/admin/member/content?id={{.uid}}" class="tz">{{.monicker}}</a><br>
						名称：{{.name}}<br>
						联系人：{{.person}}<br>
						号码：{{.tel}}<br>
						类别：{{if eq .type "0"}}营业执照{{else}}非营业执照{{end}}
					</td>
					<td>
						{{.intr}}<br>
					</td>
					<td>
						{{.addtime}}<br>
					</td>	
					<td class="operation">
						{{if eq .censoring "0"}}
						未处理<br>
						<a class="push" data-id="{{.id}}">不通过推送</a><br>
						<a class="censoring" data-id="{{.id}}">通过申请</a>
						{{else if eq .censoring "1"}}
						已通过申请
						{{else if eq .censoring "2"}}
						不通过申请<br>
						<a class="push" data-id="{{.id}}">不通过推送</a>
						{{end}}<br>
						<a href="/admin/shop/apply_detail?id={{.id}}">申请详情</a>
					</td>
				</tr>
				{{end}}
				{{if ne .paginator.totalpages 1}}
					<tr>
						<td  colspan="5">
							<div class="paging">
								{{if ne .paginator.currpage 1}}
								<a href="{{$.url}}page={{.paginator.firstpage}}">首页</a>
								<a href="{{$.url}}page={{.paginator.prevpage}}">&lt;&lt;</a>
								{{else}}
								<a class="disable">首页</a>
								<a class="disable">&lt;&lt;</a>
								{{end}}
								{{range $index,$page := .paginator.pages}}
								{{if eq $.paginator.currpage $page}} 
								<a class="no">{{$page}}</a>
								{{else}}
								<a href="{{$.url}}page={{$page}}">{{$page}}</a>
								{{end}}
								{{end}}
								{{if eq .paginator.currpage .paginator.totalpages}}
								<a class="disable">&gt;&gt;</a>
								<a class="disable">尾页</a>
								{{else}}
								<a href="{{$.url}}page={{.paginator.nextpage}}">&gt;&gt;</a>
								<a href="{{$.url}}page={{.paginator.totalpages}}">尾页</a>
								{{end}}
							</div>
						</td>
					</tr>
				{{end}}
			</table>
		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.push').click(function(){
		var id=$(this).attr('data-id');
		wxc.xcConfirm("请输入不通过的原因","input",{onOk:function(res){
			$.ajax({
				url:'/admin/shop/apply_push',
				data:{id:id,content:res},
				type:'get',
				success:function(res) {
					if(res==1){
						history.go(0)
					}else{
						wxc.xcConfirm("操作失败,请重试","error");
					}
				}
			})	
		}});
	})
	$('.censoring').click(function(){
		var id=$(this).attr('data-id');
		wxc.xcConfirm("您确定通过申请吗?","confirm",{onOk:function(){
			$.ajax({
				url:'/admin/shop/apply_censoring',
				data:{id:id},
				type:'get',
				success:function(res) {
					if(res==1){
						history.go(0)
					}else{
						wxc.xcConfirm("操作失败,请重试","error");
					}
				}
			})	
		}});
	})
</script>
</body>
</html>
